package com.demo.messagebook.aspect;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.jhello.core.annotations.aspect.Aspect;
import com.jhello.core.aspect.AbstractAdvice;
import com.jhello.core.aspect.Pointcut;

@Aspect(joincutExpression = "com.demo.messagebook.controller..*#.*")
public class MsgAspect extends AbstractAdvice {

	private long start = 0l;
	
	@Override
	public void before(Pointcut pointcut, HttpServletRequest req,
			HttpServletResponse resp) throws Exception {
		start = System.currentTimeMillis();
	}

	@Override
	public void after(Pointcut pointcut, HttpServletRequest req,
			HttpServletResponse resp) throws Exception {
		// TODO Auto-generated method stub
		System.out.println("执行时间："+(System.currentTimeMillis() - start));
	}

}
